<%@include file="_header.jsp"%>

<title>Modules</title>
</head>
<body>
    <c:choose>
        <c:when test="${userLevel == null && tryOut == null}">
            <%@include file="errorPage.jsp"%>
        </c:when><c:otherwise>
            <%@include file="_menu.jsp"%>

            <div class="sidebar">

                <div class="redbar"><a href="#"><div id="bar-textcontent">Modules</div></a>
                </div>
                <div id="sidescreen">

                    <ul class="thumbnails">
                        <li class="span4">
                            <div class="thumbnail">
                                <h3>Modules</h3>
                                <img src="icons/view_courses.png" alt="">

                                <p>${inhoud.modulesT}</p>
                            </div>
                        </li>
                    </ul>
                    <a href="announcements.jsp"><img src="icons/announcements.png" alt=""></a>

                </div>



            </div>

            <div class="wrappermain">


                <div class="digitalclass">
                    <div id="subheader"><a href="#"><div id="bar-textcontent">Modules</div></div>






                    <div class="main-digital">
                        <table class="table" >
                            <tr>
                                <td>Module ${inhoud.name}</td>
                                <td>Module ${inhoud.description}</td>
                            </tr>

                            <c:forEach var="moduleInfo" items="${modulesUitSessie}">    
                                <tr>
                                    <td>
                                        ${moduleInfo.moduleName}
                                    </td>


                                    <td>
                                        ${moduleInfo.moduleDescription}<br>
                                        <c:if test="${userLevel > 1}"> 
                                            <a href="planDigitalClass?id=${moduleInfo.moduleID}" style="color:#FF0000">${inhoud.modulesT2}</a><br>
                                            <a href="new-question?moduleid=${moduleInfo.moduleID}" style="color: #0000ff">${inhoud.modulesT3}</a><br>
                                            <c:if test="${moduleInfo.questions == true}"><a href="manage_selftest?moduleid=${moduleInfo.moduleID}" style="color:#0000ff">${inhoud.modulesT4}</a></c:if>

                                        </td>
                                        <td>
                                            <a href="change_module?moduleident=${moduleInfo.moduleID}"><img src="icons/edit_courses.png" height="50px" width="50px"></a>
                                            <a href="delete-module?moduledelete=${moduleInfo.moduleID}"><img alt="" src="icons/delete_course.png" height="50px" width="50px"></a>

                                        </td>

                                    </c:if>
                                    <c:if test="${userLevel == 1 && moduleInfo.questions == true || tryOut == true && moduleInfo.questions == true}">
                                        <td>
                                            <a href="selftest?moduleid=${moduleInfo.moduleID}"><img src="icons/stock_task.png" height="60px" width="60px"></a>
                                        </td>
                                    </c:if>
                                </tr>
                            </c:forEach>  
                            <c:if test="${userLevel > 1}">
                                <tr>
                                <a href="newModule?id=${courseID}"><img alt="" src="icons/add_modules.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                <c:if test="${course.questions == true}"><a href="manage_selftest?courseid=${courseID}"><img alt="" src="icons/Change_questions.png"></a></c:if>
                                </tr>
                            </c:if>
                        </table>


                    </div>
                </div>
            </div>
        </c:otherwise></c:choose>
</body>
</html>
